home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / ReDim.au3 < prev    next >
Text File  |  2007-09-08  |  723b  |  35 lines

  1. ; Example Resizing an array
  2. Dim $I, $K, $T, $MSG
  3. Dim $X[4][6], $Y[4][6]
  4.  
  5. For $I = 0 To 3
  6.    For $K = 0 To 5
  7.       $T = Int(Random(20) + 1)  ;Get random numbers between 1 and 20
  8.       $X[$I][$K] = $T
  9.       $Y[$I][$K] = $T
  10.    Next
  11. Next
  12.  
  13. ReDim $X[3][8]
  14. Dim $Y[3][8]
  15.  
  16. $MSG = ""
  17. For $I = 0 To UBound($X, 1) - 1
  18.    For $K = 0 To UBound($X, 2) - 1
  19.       If $K > 0 Then $MSG = $MSG & ", "
  20.       $MSG = $MSG & $X[$I][$K]
  21.    Next
  22.    $MSG = $MSG & @CR
  23. Next
  24. MsgBox(0, "ReDim Demo", $MSG)
  25.  
  26. $MSG = ""
  27. For $I = 0 To UBound($Y, 1) - 1
  28.    For $K = 0 To UBound($Y, 2) - 1
  29.       If $K > 0 Then $MSG = $MSG & ", "
  30.       $MSG = $MSG & $Y[$I][$K]
  31.    Next
  32.    $MSG = $MSG & @CR
  33. Next
  34. MsgBox(0, "ReDim Demo", $MSG)
  35.